package com.training.java.core.inheritance;



/**
 * The purpose of the player class is to observe the inheritance,immutable methods.
 * Observe the array and for each loop.
 */
public class Player {

	
	private String nameOfPlayer;
	private String status;
	private int    numberOfPlayers;
	private boolean started;
	
		
	
	//Constructor
	
	
	
	Player (String nameOfPlayer,int number,String status)
	{
		this.nameOfPlayer=nameOfPlayer;
		this.status= status;
		this.numberOfPlayers= number;
	}

	//Player start playing
	
	boolean start()
	{
		 
		if (started ==true)
			{
			System.out.println( "Player started playing true/ false :"+ started);
			
			return started;
			}
		
			else
		{
						
			System.out.println( "Player hasn't start playing, his status is  :  "+ status +" player started playing :"+started);
			return started;
		}		
			
		
	}
	
	//stop method
	
	void stop()
	{
		System.out.println("player is not playing");
	}
	
	
	
		
	
	//to know the player status
	
	String playerStatus()
	{
		
		if (status.equals("RUN"))
					
		{
			//System.out.println("player STATUS is (from Method) "+ status);
		}
		else if (status.equals("WALK"))
		
		{
			System.out.println("player STATUS is(from Method) "+ status);
		}
		
		else if(status.equals("IDLE"))
		{
			System.out.println("player STATUS is(from Method) "+ status);
		}
		else
		{
			System.out.println("Invalid  STATUS is(from Method) "+ status);
		}
		
		return status;
	}
	
	
	
	// get the info of the player.
	

	public String getStatus() {
		return status;
	}


	public String getName() {
		return nameOfPlayer;
	}


	public int getNumber() {
		return numberOfPlayers;
	}
	
	//mutating method to set the value of player.

	public void setStatus(String status) {
		this.status = status;
		
	}

	public boolean isStarted() {
		return started;
	}

	public void setStarted(boolean started) {
		this.started = started;
	}
	
}


